package l.l.w.CodingInterviews.jingdong;

import java.util.Scanner;
import java.util.Stack;

public class Three__ {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        String temp = scanner.nextLine();
        for(int i = 0; i < t; ++i){
            String str = scanner.nextLine();
            boolean isOk= isMatch(str);
            if(isOk)System.out.println("Yes");
            else System.out.println("No");
        }
    }

    private static boolean isMatch(String str) {
        Stack<Character> stack = new Stack<>();
        boolean needChange = false;
        for(int i = 0; i < str.length(); ++i){
            char c = str.charAt(i);
            if(c == '('){
                stack.push(c);
            }else{
                if(!stack.empty() && stack.peek() == '('){
                    stack.pop();
                }else{
                    stack.push('(');
                    needChange = true;
                }
            }
        }
        if(needChange && stack.size() == 2){
            char c1 = stack.pop();
            char c2 = stack.pop();
            if(c1 == '(' && c2 == '(')
                return true;
        }
        if(!needChange && stack.empty()){
            if(str.length() >= 4) return true;
        }
        return false;
    }
}
